﻿using System;
using System.Collections.Generic;
using MarketplaceWebService.Model;
using MarketplaceWebService;

namespace SysController
{
    internal static class ReportsController
    {
        ///// <summary>
        ///// 1.0 提交分类树请求报告
        ///// </summary>
        ///// <param name="model"></param>
        ///// <returns></returns>
        //public static RequestReportRequest RequestReport(UP_GetMwsModel_Result model)
        //{
        //  RequestReportRequest request = new RequestReportRequest();

        //    request.MarketplaceIdList = new IdList();
        //    request.MarketplaceIdList.Id = new List<string>(new string[] { model.MarketplaceCode });

        //    request.Merchant = model.MerchantCode;
        //    request.ReportType = ReportTypeEnum._GET_XML_BROWSE_TREE_DATA_.ToString();
        //    return request;
        //}

        //public static GetReportRequestListRequest GetReportRequestListRequest(string ReportRequestId)
        //{
        //    GetReportRequestListRequest request = new GetReportRequestListRequest(); 
        //    request.ReportRequestIdList = new IdList();
        //    request.ReportRequestIdList.Id = new List<string>(new string[] { ReportRequestId });
        //    request.ReportProcessingStatusList = new StatusList();
        //    request.ReportProcessingStatusList.Status = new List<string>(new string[] { ReportProcessingStatusEnum._DONE_.ToString() });

        //    return request;

        //}

        static MODEL.ReportRequestInfo model = new MODEL.ReportRequestInfo();

        /// <summary>
        /// cancels feed submissions - by default all of the submissions of the
        /// last 30 days that have not started processing
        /// 
        /// </summary>
        /// <param name="service">Instance of MarketplaceWebService service</param>
        /// <param name="request">CancelFeedSubmissionsRequest request</param>
        public static void InvokeCancelFeedSubmissions(MarketplaceWebService.MarketplaceWebService service, CancelFeedSubmissionsRequest request)
        {
            try
            {
                CancelFeedSubmissionsResponse response = service.CancelFeedSubmissions(request);

                if (response.IsSetCancelFeedSubmissionsResult())
                {

                    CancelFeedSubmissionsResult cancelFeedSubmissionsResult = response.CancelFeedSubmissionsResult;
                    if (cancelFeedSubmissionsResult.IsSetCount())
                    {

                    }
                    List<FeedSubmissionInfo> feedSubmissionInfoList = cancelFeedSubmissionsResult.FeedSubmissionInfo;
                    foreach (FeedSubmissionInfo feedSubmissionInfo in feedSubmissionInfoList)
                    {

                        if (feedSubmissionInfo.IsSetFeedSubmissionId())
                        {

                        }
                        if (feedSubmissionInfo.IsSetFeedType())
                        {

                        }
                        if (feedSubmissionInfo.IsSetSubmittedDate())
                        {

                        }
                        if (feedSubmissionInfo.IsSetFeedProcessingStatus())
                        {

                        }
                        if (feedSubmissionInfo.IsSetStartedProcessingDate())
                        {

                        }
                        if (feedSubmissionInfo.IsSetCompletedProcessingDate())
                        {

                        }
                    }
                }
                if (response.IsSetResponseMetadata())
                {

                    ResponseMetadata responseMetadata = response.ResponseMetadata;
                    if (responseMetadata.IsSetRequestId())
                    {

                    }
                }
            }
            catch (MarketplaceWebServiceException ex)
            {

            }
        }

        /// <summary>
        /// returns the number of feeds matching all of the specified criteria
        /// 
        /// </summary>
        /// <param name="service">Instance of MarketplaceWebService service</param>
        /// <param name="request">GetFeedSubmissionCountRequest request</param>
        public static void InvokeCancelReportRequests(MarketplaceWebService.MarketplaceWebService service, CancelReportRequestsRequest request)
        {
            try
            {
                CancelReportRequestsResponse response = service.CancelReportRequests(request);

                if (response.IsSetCancelReportRequestsResult())
                {

                    CancelReportRequestsResult cancelReportRequestsResult = response.CancelReportRequestsResult;
                    List<ReportRequestInfo> reportRequestInfoList = cancelReportRequestsResult.ReportRequestInfo;

                    foreach (ReportRequestInfo reportRequestInfo in reportRequestInfoList)
                    {

                        if (reportRequestInfo.IsSetReportProcessingStatus())
                        {

                        }
                        if (reportRequestInfo.IsSetReportRequestId())
                        {

                        }
                        if (reportRequestInfo.IsSetReportType())
                        {

                        }
                        if (reportRequestInfo.IsSetStartDate())
                        {

                        }
                        if (reportRequestInfo.IsSetEndDate())
                        {

                        }
                        if (reportRequestInfo.IsSetSubmittedDate())
                        {

                        }
                    }
                }
                if (response.IsSetResponseMetadata())
                {

                    ResponseMetadata responseMetadata = response.ResponseMetadata;
                    if (responseMetadata.IsSetRequestId())
                    {

                    }
                }
            }
            catch (MarketplaceWebServiceException ex)
            {

            }
        }

        /// <summary>
        /// returns the number of feeds matching all of the specified criteria
        /// 
        /// </summary>
        /// <param name="service">Instance of MarketplaceWebService service</param>
        /// <param name="request">GetFeedSubmissionCountRequest request</param>
        public static void InvokeGetFeedSubmissionCount(MarketplaceWebService.MarketplaceWebService service, GetFeedSubmissionCountRequest request)
        {
            try
            {
                GetFeedSubmissionCountResponse response = service.GetFeedSubmissionCount(request);
                if (response.IsSetGetFeedSubmissionCountResult())
                {
                    GetFeedSubmissionCountResult getFeedSubmissionCountResult = response.GetFeedSubmissionCountResult;
                    if (getFeedSubmissionCountResult.IsSetCount())
                    {
                    }
                }
                if (response.IsSetResponseMetadata())
                {

                    ResponseMetadata responseMetadata = response.ResponseMetadata;
                    if (responseMetadata.IsSetRequestId())
                    {

                    }
                }

            }
            catch (MarketplaceWebServiceException ex)
            {

            }
        }

        /// <summary>
        /// retrieve the next batch of list items and if there are more items to retrieve
        /// 
        /// </summary>
        /// <param name="service">Instance of MarketplaceWebService service</param>
        /// <param name="request">GetFeedSubmissionListByNextTokenRequest request</param>
        public static void InvokeGetFeedSubmissionListByNextToken(MarketplaceWebService.MarketplaceWebService service, GetFeedSubmissionListByNextTokenRequest request)
        {
            try
            {
                GetFeedSubmissionListByNextTokenResponse response = service.GetFeedSubmissionListByNextToken(request);

                if (response.IsSetGetFeedSubmissionListByNextTokenResult())
                {
                    GetFeedSubmissionListByNextTokenResult getFeedSubmissionListByNextTokenResult = response.GetFeedSubmissionListByNextTokenResult;
                    if (getFeedSubmissionListByNextTokenResult.IsSetNextToken())
                    {

                    }
                    if (getFeedSubmissionListByNextTokenResult.IsSetHasNext())
                    {

                    }
                    List<FeedSubmissionInfo> feedSubmissionInfoList = getFeedSubmissionListByNextTokenResult.FeedSubmissionInfo;
                    foreach (FeedSubmissionInfo feedSubmissionInfo in feedSubmissionInfoList)
                    {
                        if (feedSubmissionInfo.IsSetFeedSubmissionId())
                        {

                        }
                        if (feedSubmissionInfo.IsSetFeedType())
                        {
                        }
                        if (feedSubmissionInfo.IsSetSubmittedDate())
                        {
                        }
                        if (feedSubmissionInfo.IsSetFeedProcessingStatus())
                        {
                        }
                        if (feedSubmissionInfo.IsSetStartedProcessingDate())
                        {

                        }
                        if (feedSubmissionInfo.IsSetCompletedProcessingDate())
                        {

                        }
                    }
                }
                if (response.IsSetResponseMetadata())
                {
                    ResponseMetadata responseMetadata = response.ResponseMetadata;
                    if (responseMetadata.IsSetRequestId())
                    {

                    }
                }
            }
            catch (MarketplaceWebServiceException ex)
            {

            }
        }

        /// <summary>
        /// returns a list of feed submission identifiers and their associated metadata
        /// 
        /// </summary>
        /// <param name="service">Instance of MarketplaceWebService service</param>
        /// <param name="request">GetFeedSubmissionListRequest request</param>
        public static void InvokeGetFeedSubmissionList(MarketplaceWebService.MarketplaceWebService service, GetFeedSubmissionListRequest request)
        {
            try
            {
                GetFeedSubmissionListResponse response = service.GetFeedSubmissionList(request);
                if (response.IsSetGetFeedSubmissionListResult())
                {
                    GetFeedSubmissionListResult getFeedSubmissionListResult = response.GetFeedSubmissionListResult;
                    if (getFeedSubmissionListResult.IsSetNextToken())
                    {

                    }
                    if (getFeedSubmissionListResult.IsSetHasNext())
                    {

                    }
                    List<FeedSubmissionInfo> feedSubmissionInfoList = getFeedSubmissionListResult.FeedSubmissionInfo;
                    foreach (FeedSubmissionInfo feedSubmissionInfo in feedSubmissionInfoList)
                    {
                        if (feedSubmissionInfo.IsSetFeedSubmissionId())
                        {

                        }
                        if (feedSubmissionInfo.IsSetFeedType())
                        {

                        }
                        if (feedSubmissionInfo.IsSetSubmittedDate())
                        {

                        }
                        if (feedSubmissionInfo.IsSetFeedProcessingStatus())
                        {

                        }
                        if (feedSubmissionInfo.IsSetStartedProcessingDate())
                        {

                        }
                        if (feedSubmissionInfo.IsSetCompletedProcessingDate())
                        {

                        }
                    }
                }
                if (response.IsSetResponseMetadata())
                {
                    ResponseMetadata responseMetadata = response.ResponseMetadata;
                    if (responseMetadata.IsSetRequestId())
                    {

                    }
                }
            }
            catch (MarketplaceWebServiceException ex)
            {

            }
        }

        /// <summary>
        /// retrieves the feed processing report
        /// 
        /// </summary>
        /// <param name="service">Instance of MarketplaceWebService service</param>
        /// <param name="request">GetFeedSubmissionResultRequest request</param>
        public static void InvokeGetFeedSubmissionResult(MarketplaceWebService.MarketplaceWebService service, GetFeedSubmissionResultRequest request)
        {
            try
            {
                GetFeedSubmissionResultResponse response = service.GetFeedSubmissionResult(request);
                if (response.IsSetGetFeedSubmissionResultResult())
                {

                    GetFeedSubmissionResultResult getFeedSubmissionResultResult = response.GetFeedSubmissionResultResult;
                    if (getFeedSubmissionResultResult.IsSetContentMD5())
                    {

                    }
                }

                if (response.IsSetResponseMetadata())
                {
                    ResponseMetadata responseMetadata = response.ResponseMetadata;
                    if (responseMetadata.IsSetRequestId())
                    {

                    }
                }
            }
            catch (MarketplaceWebServiceException ex)
            {

            }
        }

        /// <summary>
        /// returns a count of reports matching your criteria;
        /// by default, the number of reports generated in the last 90 days,
        /// regardless of acknowledgement status
        /// 
        /// </summary>
        /// <param name="service">Instance of MarketplaceWebService service</param>
        /// <param name="request">GetReportCountRequest request</param>
        public static void InvokeGetReportCount(MarketplaceWebService.MarketplaceWebService service, GetReportCountRequest request)
        {
            try
            {
                GetReportCountResponse response = service.GetReportCount(request);
                if (response.IsSetGetReportCountResult())
                {
                    GetReportCountResult getReportCountResult = response.GetReportCountResult;
                    if (getReportCountResult.IsSetCount())
                    {
                    }
                }
                if (response.IsSetResponseMetadata())
                {
                    ResponseMetadata responseMetadata = response.ResponseMetadata;
                    if (responseMetadata.IsSetRequestId())
                    {

                    }
                }
            }
            catch (MarketplaceWebServiceException ex)
            {
            }
        }

        /// <summary>
        /// retrieve the next batch of list items and if there are more items to retrieve
        /// 
        /// </summary>
        /// <param name="service">Instance of MarketplaceWebService service</param>
        /// <param name="request">GetReportListByNextTokenRequest request</param>
        public static void InvokeGetReportListByNextToken(MarketplaceWebService.MarketplaceWebService service, GetReportListByNextTokenRequest request)
        {
            try
            {
                GetReportListByNextTokenResponse response = service.GetReportListByNextToken(request);
                if (response.IsSetGetReportListByNextTokenResult())
                {
                    GetReportListByNextTokenResult getReportListByNextTokenResult = response.GetReportListByNextTokenResult;
                    if (getReportListByNextTokenResult.IsSetNextToken())
                    {

                    }
                    if (getReportListByNextTokenResult.IsSetHasNext())
                    {
                    }
                    List<ReportInfo> reportInfoList = getReportListByNextTokenResult.ReportInfo;
                    foreach (ReportInfo reportInfo in reportInfoList)
                    {
                        if (reportInfo.IsSetReportId())
                        {

                        }
                        if (reportInfo.IsSetReportType())
                        {
                        }
                        if (reportInfo.IsSetReportRequestId())
                        {

                        }
                        if (reportInfo.IsSetAvailableDate())
                        {

                        }
                        if (reportInfo.IsSetAcknowledged())
                        {

                        }
                        if (reportInfo.IsSetAcknowledgedDate())
                        {

                        }
                    }
                }
                if (response.IsSetResponseMetadata())
                {
                    ResponseMetadata responseMetadata = response.ResponseMetadata;
                    if (responseMetadata.IsSetRequestId())
                    {

                    }
                }
            }
            catch (MarketplaceWebServiceException ex)
            {

            }
        }

        /// <summary>
        /// returns a list of reports; by default the most recent ten reports,
        /// regardless of their acknowledgement status
        /// 
        /// </summary>
        /// <param name="service">Instance of MarketplaceWebService service</param>
        /// <param name="request">GetReportListRequest request</param>
        public static void InvokeGetReportList(MarketplaceWebService.MarketplaceWebService service, GetReportListRequest request)
        {
            try
            {
                GetReportListResponse response = service.GetReportList(request);
                if (response.IsSetGetReportListResult())
                {
                    GetReportListResult getReportListResult = response.GetReportListResult;
                    if (getReportListResult.IsSetNextToken())
                    { }
                    if (getReportListResult.IsSetHasNext())
                    { }
                    List<ReportInfo> reportInfoList = getReportListResult.ReportInfo;
                    foreach (ReportInfo reportInfo in reportInfoList)
                    {
                        if (reportInfo.IsSetReportId())
                        {  }
                        if (reportInfo.IsSetReportType())
                        {  }
                        if (reportInfo.IsSetReportRequestId())
                        {  }
                        if (reportInfo.IsSetAvailableDate())
                        { }
                        if (reportInfo.IsSetAcknowledged())
                        {

                        }
                        if (reportInfo.IsSetAcknowledgedDate())
                        {

                        }
                    }
                }
                if (response.IsSetResponseMetadata())
                {
                    ResponseMetadata responseMetadata = response.ResponseMetadata;
                    if (responseMetadata.IsSetRequestId())
                    {
                    }
                }
            }
            catch (MarketplaceWebServiceException ex)
            {

            }
        }

        /// <summary>
        /// returns the number of feeds matching all of the specified criteria
        /// 
        /// </summary>
        /// <param name="service">Instance of MarketplaceWebService service</param>
        /// <param name="request">GetReportRequestCountRequest request</param>
        public static void InvokeGetReportRequestCount(MarketplaceWebService.MarketplaceWebService service, GetReportRequestCountRequest request)
        {
            try
            {
                GetReportRequestCountResponse response = service.GetReportRequestCount(request);
                if (response.IsSetGetReportRequestCountResult())
                {

                    GetReportRequestCountResult getReportRequestCountResult = response.GetReportRequestCountResult;
                    if (getReportRequestCountResult.IsSetCount())
                    {

                    }
                }
                if (response.IsSetResponseMetadata())
                {

                    ResponseMetadata responseMetadata = response.ResponseMetadata;
                    if (responseMetadata.IsSetRequestId())
                    {

                    }
                }
            }
            catch (MarketplaceWebServiceException ex)
            {

            }
        }

        /// <summary>
        /// retrieve the next batch of list items and if there are more items to retrieve
        /// 
        /// </summary>
        /// <param name="service">Instance of MarketplaceWebService service</param>
        /// <param name="request">GetReportListByNextTokenRequest request</param>
        public static void InvokeGetReportRequestListByNextToken(MarketplaceWebService.MarketplaceWebService service, GetReportRequestListByNextTokenRequest request)
        {
            try
            {
                GetReportRequestListByNextTokenResponse response = service.GetReportRequestListByNextToken(request);
                if (response.IsSetGetReportRequestListByNextTokenResult())
                {
                    GetReportRequestListByNextTokenResult getReportRequestListByNextTokenResult = response.GetReportRequestListByNextTokenResult;
                    if (getReportRequestListByNextTokenResult.IsSetNextToken())
                    {
                    }
                    if (getReportRequestListByNextTokenResult.IsSetHasNext())
                    {

                    }
                    List<ReportRequestInfo> reportRequestInfoList = getReportRequestListByNextTokenResult.ReportRequestInfo;
                    foreach (ReportRequestInfo reportRequestInfo in reportRequestInfoList)
                    {
                        if (reportRequestInfo.IsSetReportType())
                        {
                        }
                        if (reportRequestInfo.IsSetReportRequestId())
                        {
                        }
                        if (reportRequestInfo.IsSetGeneratedReportId())
                        {
                        }
                        if (reportRequestInfo.IsSetStartDate())
                        {
                        }
                        if (reportRequestInfo.IsSetSubmittedDate())
                        {

                        }
                        if (reportRequestInfo.IsSetEndDate())
                        {
                        }
                    }
                }
                if (response.IsSetResponseMetadata())
                {

                    ResponseMetadata responseMetadata = response.ResponseMetadata;
                    if (responseMetadata.IsSetRequestId())
                    {

                    }
                }
            }
            catch (MarketplaceWebServiceException ex)
            {
            }
        }

        /// <summary>
        /// returns the number of feeds matching all of the specified criteria
        /// 
        /// </summary>
        /// <param name="service">Instance of MarketplaceWebService service</param>
        /// <param name="request">GetFeedSubmissionCountRequest request</param>
        public static void InvokeGetReportRequestList(MarketplaceWebService.MarketplaceWebService service, GetReportRequestListRequest request)
        {
            try
            {
                GetReportRequestListResponse response = service.GetReportRequestList(request);
                ResponseMetadata responseMetadata =null;
                if (response.IsSetResponseMetadata())
                {
                    responseMetadata = response.ResponseMetadata;
                    if (responseMetadata.IsSetRequestId())  { }
                }
                if (response.IsSetGetReportRequestListResult())
                {
                    GetReportRequestListResult getReportRequestListResult = response.GetReportRequestListResult;
                    List<ReportRequestInfo> reportRequestInfoList = getReportRequestListResult.ReportRequestInfo; 
                    foreach (ReportRequestInfo reportRequestInfo in reportRequestInfoList)
                    {
                        model = new MODEL.ReportRequestInfo();
                        if (reportRequestInfo.IsSetReportProcessingStatus())   {  }
                        if (reportRequestInfo.IsSetReportRequestId()) {  }
                        if (reportRequestInfo.IsSetGeneratedReportId()) { }
                        if (reportRequestInfo.IsSetReportType()) { }
                        if (reportRequestInfo.IsSetStartDate()) {  }
                        if (reportRequestInfo.IsSetEndDate()) {  }
                        if (reportRequestInfo.IsSetSubmittedDate()) {  }
                        model.SubmittedDate = reportRequestInfo.SubmittedDate;
                        model.StartDate = reportRequestInfo.StartDate;
                        model.ReportType = reportRequestInfo.ReportType;
                        model.ReportRequestInfo_Id = reportRequestInfo.ReportRequestId;
                        model.ReportProcessingStatus = reportRequestInfo.ReportProcessingStatus;
                        model.EndDate = reportRequestInfo.EndDate;
                        model.GeneratedReportId = reportRequestInfo.GeneratedReportId;
                        model.IsDel = false;  
                        model.UpdateUser = "FL2";
                        model.UpdateTime = DateTime.Now;
                        model.RequestId = responseMetadata.RequestId;
                        SysHelper.OperateContext.CurrentContext.BllSession.IReportRequestInfo_BLL.ModifyIsNullADD(model, s => s.IsDel == false && s.ReportRequestInfo_Id == model.ReportRequestInfo_Id, true);                        
                    }
                }
                int count = SysHelper.OperateContext.CurrentContext.BllSession.SaveChanges("ReportRequestInfo");
            }
            catch (MarketplaceWebServiceException ex)
            {
            }
        }

        /// <summary>
        /// The GetReport operation returns the contents of a report. Reports can potentially be
        /// very large (>100MB) which is why we only return one report at a time, and in a
        /// streaming fashion.
        /// 
        /// </summary>
        /// <param name="service">Instance of MarketplaceWebService service</param>
        /// <param name="request">GetReportRequest request</param>
        public static void InvokeGetReport(MarketplaceWebService.MarketplaceWebService service, GetReportRequest request)
        {
            try
            {
                GetReportResponse response = service.GetReport(request);
                if (response.IsSetGetReportResult())
                {
                    GetReportResult getReportResult = response.GetReportResult;
                    if (getReportResult.IsSetContentMD5())
                    {
                    }
                }
                if (response.IsSetResponseMetadata())
                {
                    ResponseMetadata responseMetadata = response.ResponseMetadata;
                    if (responseMetadata.IsSetRequestId())
                    {
                    }
                }
            }
            catch (MarketplaceWebServiceException ex)
            {
            }
        }

        /// <summary>
        /// returns the number of report schedules
        /// 
        /// </summary>
        /// <param name="service">Instance of MarketplaceWebService service</param>
        /// <param name="request">GetReportScheduleCountRequest request</param>
        public static void InvokeGetReportScheduleCount(MarketplaceWebService.MarketplaceWebService service, GetReportScheduleCountRequest request)
        {
            try
            {
                GetReportScheduleCountResponse response = service.GetReportScheduleCount(request);
                if (response.IsSetGetReportScheduleCountResult())
                {
                    GetReportScheduleCountResult getReportScheduleCountResult = response.GetReportScheduleCountResult;
                    if (getReportScheduleCountResult.IsSetCount())
                    {
                    }
                }
                if (response.IsSetResponseMetadata())
                {
                    ResponseMetadata responseMetadata = response.ResponseMetadata;
                    if (responseMetadata.IsSetRequestId())
                    {
                    }
                }

            }
            catch (MarketplaceWebServiceException ex)
            {
            }
        }

        /// <summary>
        /// retrieve the next batch of list items and if there are more items to retrieve
        /// 
        /// </summary>
        /// <param name="service">Instance of MarketplaceWebService service</param>
        /// <param name="request">GetReportScheduleListByNextTokenRequest request</param>
        public static void InvokeGetReportScheduleListByNextToken(MarketplaceWebService.MarketplaceWebService service, GetReportScheduleListByNextTokenRequest request)
        {
            try
            {
                GetReportScheduleListByNextTokenResponse response = service.GetReportScheduleListByNextToken(request);
                if (response.IsSetGetReportScheduleListByNextTokenResult())
                {
                    GetReportScheduleListByNextTokenResult getReportScheduleListByNextTokenResult = response.GetReportScheduleListByNextTokenResult;
                    if (getReportScheduleListByNextTokenResult.IsSetNextToken())
                    {
                    }
                    if (getReportScheduleListByNextTokenResult.IsSetHasNext())
                    {
                    }
                    List<ReportSchedule> reportScheduleList = getReportScheduleListByNextTokenResult.ReportSchedule;
                    foreach (ReportSchedule reportSchedule in reportScheduleList)
                    {
                        if (reportSchedule.IsSetReportType())
                        {
                        }
                        if (reportSchedule.IsSetSchedule())
                        {
                        }
                        if (reportSchedule.IsSetScheduledDate())
                        {
                        }
                    }
                }
                if (response.IsSetResponseMetadata())
                {
                    ResponseMetadata responseMetadata = response.ResponseMetadata;
                    if (responseMetadata.IsSetRequestId())
                    {
                    }
                }
            }
            catch (MarketplaceWebServiceException ex)
            {
            }
        }

        /// <summary>
        /// returns the list of report schedules
        /// 
        /// </summary>
        /// <param name="service">Instance of MarketplaceWebService service</param>
        /// <param name="request">GetReportScheduleListRequest request</param>
        public static void InvokeGetReportScheduleList(MarketplaceWebService.MarketplaceWebService service, GetReportScheduleListRequest request)
        {
            try
            {
                GetReportScheduleListResponse response = service.GetReportScheduleList(request);
                if (response.IsSetGetReportScheduleListResult())
                {
                    GetReportScheduleListResult getReportScheduleListResult = response.GetReportScheduleListResult;
                    if (getReportScheduleListResult.IsSetNextToken())
                    {
                    }
                    if (getReportScheduleListResult.IsSetHasNext())
                    {
                    }
                    List<ReportSchedule> reportScheduleList = getReportScheduleListResult.ReportSchedule;
                    foreach (ReportSchedule reportSchedule in reportScheduleList)
                    {
                        if (reportSchedule.IsSetReportType())
                        {
                        }
                        if (reportSchedule.IsSetSchedule())
                        {
                        }
                        if (reportSchedule.IsSetScheduledDate())
                        {
                        }
                    }
                }
                if (response.IsSetResponseMetadata())
                {
                    ResponseMetadata responseMetadata = response.ResponseMetadata;
                    if (responseMetadata.IsSetRequestId())
                    {
                    }
                }
            }
            catch (MarketplaceWebServiceException ex)
            {
            }
        }

        /// <summary>
        /// Creates, updates, or deletes a report schedule
        /// for a given report type, such as order reports in particular.
        /// 
        /// </summary>
        /// <param name="service">Instance of MarketplaceWebService service</param>
        /// <param name="request">ManageReportScheduleRequest request</param>
        public static void InvokeManageReportSchedule(MarketplaceWebService.MarketplaceWebService service, ManageReportScheduleRequest request)
        {
            try
            {
                ManageReportScheduleResponse response = service.ManageReportSchedule(request);
                if (response.IsSetManageReportScheduleResult())
                {
                    ManageReportScheduleResult manageReportScheduleResult = response.ManageReportScheduleResult;
                    if (manageReportScheduleResult.IsSetCount())
                    {
                    }
                    List<ReportSchedule> reportScheduleList = manageReportScheduleResult.ReportSchedule;
                    foreach (ReportSchedule reportSchedule in reportScheduleList)
                    {
                        if (reportSchedule.IsSetReportType())
                        {
                        }
                        if (reportSchedule.IsSetSchedule())
                        {
                        }
                        if (reportSchedule.IsSetScheduledDate())
                        {
                        }
                    }
                }
                if (response.IsSetResponseMetadata())
                {
                    ResponseMetadata responseMetadata = response.ResponseMetadata;
                    if (responseMetadata.IsSetRequestId())
                    {
                    }
                }

            }
            catch (MarketplaceWebServiceException ex)
            {
            }
        }

        /// <summary>
        /// Uploads a file for processing together with the necessary
        /// metadata to process the file, such as which type of feed it is.
        /// PurgeAndReplace if true means that your existing e.g. inventory is
        /// wiped out and replace with the contents of this feed - use with
        /// caution (the default is false).
        /// 
        /// </summary>
        /// <param name="service">Instance of MarketplaceWebService service</param>
        /// <param name="request">SubmitFeedRequest request</param>
        public static void InvokeSubmitFeed(MarketplaceWebService.MarketplaceWebService service, SubmitFeedRequest request)
        {
            try
            {
                SubmitFeedResponse response = service.SubmitFeed(request);
                if (response.IsSetSubmitFeedResult())
                {
                    SubmitFeedResult submitFeedResult = response.SubmitFeedResult;
                    if (submitFeedResult.IsSetFeedSubmissionInfo())
                    {
                        FeedSubmissionInfo feedSubmissionInfo = submitFeedResult.FeedSubmissionInfo;
                        if (feedSubmissionInfo.IsSetFeedSubmissionId())
                        {
                        }
                        if (feedSubmissionInfo.IsSetFeedType())
                        {
                        }
                        if (feedSubmissionInfo.IsSetSubmittedDate())
                        {
                        }
                        if (feedSubmissionInfo.IsSetFeedProcessingStatus())
                        {
                        }
                        if (feedSubmissionInfo.IsSetStartedProcessingDate())
                        {
                        }
                        if (feedSubmissionInfo.IsSetCompletedProcessingDate())
                        {
                        }
                    }
                }
                if (response.IsSetResponseMetadata())
                {
                    ResponseMetadata responseMetadata = response.ResponseMetadata;
                    if (responseMetadata.IsSetRequestId())
                    {
                    }
                }

            }
            catch (MarketplaceWebServiceException ex)
            {
            }
        }

        /// <summary>
        /// The UpdateReportAcknowledgements operation updates the acknowledged status of one or more reports.
        /// 
        /// </summary>
        /// <param name="service">Instance of MarketplaceWebService service</param>
        /// <param name="request">UpdateReportAcknowledgementsRequest request</param>
        public static void InvokeUpdateReportAcknowledgements(MarketplaceWebService.MarketplaceWebService service, UpdateReportAcknowledgementsRequest request)
        {
            try
            {
                UpdateReportAcknowledgementsResponse response = service.UpdateReportAcknowledgements(request);

                if (response.IsSetUpdateReportAcknowledgementsResult())
                {
                    UpdateReportAcknowledgementsResult updateReportAcknowledgementsResult = response.UpdateReportAcknowledgementsResult;
                    if (updateReportAcknowledgementsResult.IsSetCount())
                    {
                    }
                    List<ReportInfo> reportInfoList = updateReportAcknowledgementsResult.ReportInfo;
                    foreach (ReportInfo reportInfo in reportInfoList)
                    {
                        if (reportInfo.IsSetReportId())
                        {
                        }
                        if (reportInfo.IsSetReportType())
                        {
                        }
                        if (reportInfo.IsSetReportRequestId())
                        {
                        }
                        if (reportInfo.IsSetAvailableDate())
                        {
                        }
                        if (reportInfo.IsSetAcknowledged())
                        {
                        }
                        if (reportInfo.IsSetAcknowledgedDate())
                        {
                        }
                    }
                }
                if (response.IsSetResponseMetadata())
                {
                    ResponseMetadata responseMetadata = response.ResponseMetadata;
                    if (responseMetadata.IsSetRequestId())
                    {
                    }
                }
            }
            catch (MarketplaceWebServiceException ex)
            {
            }
        }

        /// <summary>
        /// returns the number of feeds matching all of the specified criteria
        /// 
        /// </summary>
        /// <param name="service">Instance of MarketplaceWebService service</param>
        /// <param name="request">GetFeedSubmissionCountRequest request</param>
        public static void InvokeRequestReport(MarketplaceWebService.MarketplaceWebService service, RequestReportRequest request)
        {
            try
            {
                RequestReportResponse response = service.RequestReport(request);
                if (response.IsSetRequestReportResult())
                {
                    RequestReportResult requestReportResult = response.RequestReportResult;
                    ReportRequestInfo reportRequestInfo = requestReportResult.ReportRequestInfo;
                    if (reportRequestInfo.IsSetReportProcessingStatus()) { }
                    if (reportRequestInfo.IsSetReportRequestId()) { }
                    if (reportRequestInfo.IsSetReportType()) { }
                    if (reportRequestInfo.IsSetStartDate()) { }
                    if (reportRequestInfo.IsSetEndDate()) { }
                    if (reportRequestInfo.IsSetSubmittedDate()) { }

                    model.SubmittedDate = reportRequestInfo.SubmittedDate;
                    model.StartDate = reportRequestInfo.StartDate;
                    model.ReportType = reportRequestInfo.ReportType;
                    model.ReportRequestInfo_Id = reportRequestInfo.ReportRequestId;
                    model.ReportProcessingStatus = reportRequestInfo.ReportProcessingStatus;
                    model.EndDate = reportRequestInfo.EndDate;
                    model.GeneratedReportId = reportRequestInfo.GeneratedReportId;
                    model.IsDel = false;
                    model.CreateUser = "RequestReport";
                    model.CreateTime = DateTime.Now;
                    model.UpdateUser = "FL";
                    model.UpdateTime = DateTime.Now;

                }
                if (response.IsSetResponseMetadata())
                {
                    ResponseMetadata responseMetadata = response.ResponseMetadata;
                    if (responseMetadata.IsSetRequestId()) { }
                    model.RequestId = responseMetadata.RequestId;
                }
                SysHelper.OperateContext.CurrentContext.BllSession.IReportRequestInfo_BLL.ModifyIsNullADD(model, s => s.IsDel == false && s.ReportRequestInfo_Id == model.ReportRequestInfo_Id, true);
               int count= SysHelper.OperateContext.CurrentContext.BllSession.SaveChanges("ReportRequestInfo");
            }
            catch (MarketplaceWebServiceException ex)
            {
            }
        }
    }
}
